package chp03.ext;

public class Ext1 {

    public static void main(String[] args) {
        while(true) {
            double ran = Math.random();
            //转为1500-2000的整数随机数
            int num3 = (int) (ran * (2000 - 1500 + 1)) + 1500;
            if(num3 == 1499){
                System.out.println("1499找到了");
                break;
            }
            if(num3 == 2001){
                System.out.println("2001找到了");
                break;
            }
            if(num3 == 1500){
                System.out.println("1500找到了");
            }
            if(num3 == 2000){
                System.out.println("2000找到了");

            }
        }
    }
}
